Some graphics processing techniques that improve performance benefit from an ability to uniquely identify primitives or enumerate primitives within a scene or within a three-dimensional (3D) object. For example, deferred shading renders a scene in a first processing pass to perform hidden surface removal (i.e., z-buffering) without shading the pixels. Then, the scene is rendered in a second processing pass to shade the visible pixels. To shade the pixels, the graphics processor determines which primitive is visible for each pixel by comparing data generated and stored during the first pass with data generated during the second pass (e.g., normal vector, texture map parameters, and z or depth).
When the data generated for the second pass is not guaranteed to be the same as the data generated for the first pass, determination of the visible primitives by comparing the data can be unreliable. When multiple samples are used to generate an anti-aliased image, comparing the data can also be unreliable because more than one primitive may be visible for a single pixel and it may not be possible to determine which primitives are the visible primitives. The data that is compared does not necessarily distinguish between two primitives. In other words, the data that is stored during the first pass does not provide a unique identifier for a primitive.
Thus, there is a need for addressing the issue of uniquely identifying primitives and/or other issues associated with the prior art.